<template>
	<div>
		<common-view ref="commonView" :SearchSet="searchSet" :SearchForm="searchForm" :SearchData="searchData" :TableSet="tableSet" :Columns="columns" :DialogSet="dialogSet" :DialogFormData="dialogFormData" :DialogForm="dialogForm" :RequestController="requestController" :DataList="dataList" :pageSearch="pageSearch" @handleQueryCallBack="handleQueryCallBack" @addCallBack="addCallBack" @updateCallBack="updateCallBack" @deleteCallBack="deleteCallBack">
		</common-view>
	</div>
</template>

<script>
import CommonView from "@/components/common/CommonView.vue";
export default {
	components: {
		CommonView,
	},
	data() {
		return {
			//页面组件配置
			//===================================================//
			//搜索框按钮
			//搜索框及搜索按钮是否展示
			searchSet: {
				searchButtenShow: true,
				labelWidth: "80px"
			},
			//搜索框配置及数据
			searchData: {
			},
			searchForm: [
				{
					type: "Input",
					label: "操作人",
					prop: "h_operator",
					width: "100px",
					placeholder: "",
					enternative: this.handleQuery, //按下enter执行的函数
				},
				{
					type: "Input",
					label: "试验名称",
					prop: "h_name",
					width: "100px",
					placeholder: "",
					enternative: this.handleQuery, //按下enter执行的函数
				},
				{
					type: "datetimerange",
					label: "操作时间",
					prop: "record_time",
					width: "350px",
					placeholder: "",
					enternative: this.handleQuery, //按下enter执行的函数
					change: (data) => {
						// alert(data)
					}
				}
			],
			//表格相关配置
			tableSet: {
				selection: true, //是否显示多选框
				showKey: true, //显示索引列
				idColum: "h_id", //（id）主键列名称
			},
			//表格表头数据
			//Object.freeze 百度去理解 提升性能并且禁止对于该对象的属性进行修改（
			columns: Object.freeze([
				{
					sortable: true,
					attrs: {
						prop: "h_handle_time",
						label: "操作时间",
						width: "150",
						align: "center",
						// "show-overflow-tooltip": true,
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_operator",
						label: "操作人",
						width: "100",
						align: "center",
						// "show-overflow-tooltip": true,
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_name",
						label: "试验名称",
						width: "110",
						align: "center",
						// "show-overflow-tooltip": true,
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "planeName",
						label: "飞机名称",
						width: "110",
						align: "center",
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_sprinklerId",
						label: "喷头id开启/关闭",
						width: "150",
						align: "center",
						// "show-overflow-tooltip": true,
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_drainSk",
						label: "排空",
						align: "center",
						// width: "100",
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_replenishWater",
						label: "补水",
						align: "center",
						// width: "110",
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_skPlace",
						label: "喷头位移",
						align: "center",
						width: "110",
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_plc_controlCode",
						label: "通信代码",
						align: "center",
						width: "110",
					},
				},
				{
					sortable: true,
					attrs: {
						prop: "h_memo",
						label: "备注",
						align: "center",
						width: "100",
					},
				}
			]),
			//新增编辑弹出框相关配置
			dialogSet: {
				title: "",
				isEdit: false,
				dialogVisible: false,
			},
			//新增编辑相关信息
			dialogFormData: {},
			//新增编辑form
			dialogForm: {
				labelWidth: "100px",
				inline: false,
				labelPosition: "right",
				size: "small",
				formItem: [

				],
			},
			downloadLoading: false,
			dataList: [],
			//传给dialog的row
			dialogRow: {},
			//页面逻辑参数等
			//=======================================================//
			//选中的行
			requestController: "HandleRecord",
			pageSearch: true, //是否分页
			dialogVisible: false,
			checkList: [],
			sprinklerBigList: [],
			sprinklersmallList: [],
			sprinklerLeftList: [],
			sprinklerRightList: [],
			spanClass: false,
			pId: 0,

		};
	},
	mounted: function () {

	},
	methods: {
		openDialog(row) {
			this.dialogRow = row;
			this.dialogVisible = true;

		},
		handleQuery() {
			this.$refs.commonView.handleQuery();
		},
		//修正返回表格list数据(访问list返回成功回调)
		handleQueryCallBack(res) {
			this.dataList = res.bodyList;
		},
		///新增回调
		addCallBack(res) { },
		//更新回调
		updateCallBack(res) { },
		//删除回调
		deleteCallBack(res) { },
		Export() {
			this.downloadLoading = true;
			// this.downloadLoading=false;
		},
	},
};
</script>
<style lang="scss" >
.el-form-item {
	margin-bottom: 0px;
}
.checkbox {
	margin-top: 10px;
	width: 100px;
	margin-right: 5px;
}
.checkbox.is-bordered.is-checked {
	background-color: #409eff;
}
//多选框选中的默认字体颜色
.checkboxClass {
	color: #fff;
}
//隐藏了多选框的勾选框
// .el-checkbox__inner {
//   display: none;
// }
//多选框的默认字体颜色
.checkboxClassDefault {
	color: #606266;
}
.span {
	color: #fff;
}
</style>
